// 编写methods中方法
export default {
    data:{
        cyclesNum:0,  //需要验证的次数
        VerificationTime:0, // 每次验证的间隔时间
    },
    methods:{
        showFaceMode(allplayertime,that){
            // clearTimeout(that.facetimeObj);
            // duration = this.Aliplayer.getDuration()
            // current = this.Aliplayer.getCurrentTime()
            let fifteenminute = 15 * 60
            // let thirtyminute = 30 * 60
            // let allplayertime = this.$refs.videoPlayer.player.duration()
            if(allplayertime>fifteenminute){
                // this.cyclesNum = Math.floor(allplayertime/fifteenminute)
                if(Math.ceil(that.timeNow/fifteenminute) * fifteenminute > allplayertime){
                    that.VerificationTime = fifteenminute * (Math.ceil(that.timeNow/fifteenminute) - 1)
                }else{
                    that.VerificationTime = Math.ceil(that.timeNow/fifteenminute) * fifteenminute
                }
            }
           
            // if(that.VerificationTime<=that.timeNow){
            //     that.faceTimePause(1)
            // }
            // if(this.VerificationTime=this.timeNow){
            //     this.faceTimePause(0)
            // }
            
        }
    },
    created(allplayertime,that){
        let fifteenminute = 15 * 60
        if(allplayertime>fifteenminute){
            that.cyclesNum = Math.floor(allplayertime/fifteenminute)
        }else{
            that.cyclesNum = 1
        }
        if(allplayertime<=fifteenminute &&that.cyclesNum){
            // this.cyclesNum = 1
            that.VerificationTime = (Number((Math.random()*(Math.floor(allplayertime/60)-1)+1).toFixed(0)) * 60) 
        }
        this.methods.showFaceMode(allplayertime,that)
    }
}